home *** CD-ROM | disk | FTP | other *** search
- {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- (c) TechInsite Pty. Ltd.
- PO Box 429, Abbotsford, Melbourne. 3067 Australia
- Phone: +61 3 9419 6456
- Fax: +61 3 9419 1682
- Web: www.techinsite.com.au
- EMail: peter_hinrichsen@techinsite.com.au
-
- Created: October 1999
-
- Notes: Main form for Observer Example
-
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
- unit FMain;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls,
- Forms, Dialogs, ComCtrls, ToolWin, ImgList, Menus,
- ActnList;
-
- type
- TFormMain = class(TForm)
- ToolBar1: TToolBar;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- ToolButton5: TToolButton;
- ImageList1: TImageList;
- ActionList1: TActionList;
- MainMenu1: TMainMenu;
- aGrid: TAction;
- aBarGraph: TAction;
- aPieGraph: TAction;
- aClose: TAction;
- File1: TMenuItem;
- N1: TMenuItem;
- Grid1: TMenuItem;
- BarGraph1: TMenuItem;
- PieGraph1: TMenuItem;
- Close1: TMenuItem;
- Window1: TMenuItem;
- Tile1: TMenuItem;
- Cascade1: TMenuItem;
- N2: TMenuItem;
- Closeall1: TMenuItem;
- procedure aGridExecute(Sender: TObject);
- procedure aBarGraphExecute(Sender: TObject);
- procedure aPieGraphExecute(Sender: TObject);
- procedure aCloseExecute(Sender: TObject);
- procedure Tile1Click(Sender: TObject);
- procedure Cascade1Click(Sender: TObject);
- procedure Closeall1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- FormMain: TFormMain;
-
- implementation
-
- uses
- Subject_Portfolio // To give access to the gPortfolio
- ,FObserver_Abstract
- ,FObserver_Grid
- ,FObserver_BarGraph
- ,FObserver_PieGraph
- ;
-
- {$R *.DFM}
-
- //----------------------------------------------------------
- procedure TFormMain.aGridExecute(Sender: TObject);
- var
- lObserver : TFormObserverAbstract ;
- begin
- lObserver := TFormObserverGrid.Create( Application ) ;
- lObserver.Show ;
- end;
-
- //----------------------------------------------------------
- procedure TFormMain.aBarGraphExecute(Sender: TObject);
- var
- lObserver : TFormObserverAbstract ;
- begin
- lObserver := TFormObserverBarGraph.Create( Application ) ;
- lObserver.Show ;
- end;
-
- //----------------------------------------------------------
- procedure TFormMain.aPieGraphExecute(Sender: TObject);
- var
- lObserver : TFormObserverAbstract ;
- begin
- lObserver := TFormObserverPieGraph.Create( Application ) ;
- lObserver.Show ;
- end;
-
- //----------------------------------------------------------
- procedure TFormMain.aCloseExecute(Sender: TObject);
- begin
- Close ;
- end;
-
- //----------------------------------------------------------
- procedure TFormMain.Tile1Click(Sender: TObject);
- begin
- Tile ;
- end;
-
- //----------------------------------------------------------
- procedure TFormMain.Cascade1Click(Sender: TObject);
- begin
- Cascade ;
- end;
-
- //----------------------------------------------------------
- procedure TFormMain.Closeall1Click(Sender: TObject);
- var
- i : integer ;
- begin
- for i := MDIChildCount - 1 downto 0 do
- MDIChildren[i].Close ;
- end;
-
- end.
-
-